package com.example.hyw.szysteam.model;

import com.example.hyw.szysteam.POJO.CLassMember;
import com.example.hyw.szysteam.POJO.ClassItem;
import com.example.hyw.szysteam.POJO.HttpResult;
import com.example.hyw.szysteam.http.RetrofitManager;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;

/**
 * Created by HYW on 2018/6/7.
 */

public class ClassModel {
    public Observable<HttpResult<String>> createClass(String email,String classname,String teacher){
        return RetrofitManager.getInstance().getRetrofitApiService().createclass(email,classname,teacher);
    }

    public Observable<HttpResult<ArrayList<ClassItem>>> getclass(String email){
        return RetrofitManager.getInstance().getRetrofitApiService().getclass(email);
    }

    public Observable<HttpResult<String>> joinclass(String email,String classid){
        return RetrofitManager.getInstance().getRetrofitApiService().joinclass(email,classid);
    }

    public Observable<HttpResult<ArrayList<CLassMember>>> classmember(String classid){
        return RetrofitManager.getInstance().getRetrofitApiService().classmember(classid);
    }
}
